package com.westcom.healthmate.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.westcom.healthmate.common.constants.ErrorConstants;
import com.westcom.healthmate.common.constants.ErrorConstants.*;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ResponseBean
{
    @JSONField(name="code")
    private String code = null;

    @JSONField(name="msg")
    private String msg = null;

    @JSONField(name="data")
    private Object data = null;

    public void setCode(String code)
    {
        OperationStatus status = ErrorConstants.OPERATION_STATUS.get(code);
        if(null != status)
        {
            this.msg = status.getMsg();
        }
        this.code = code;
    }
}
